#pragma once

#include <iostream>
#include <string>

// #include "ids.hpp"
#include "io/DbInterface.h"
#include "api/TimingIDBAdapter.hh"
#include "api/TimingEngine.hh"
#include "opt/TimingOptimizer.h"

namespace idb {
class IdbPin;
class IdbInstance;
class IdbInstanceList;
class IdbNet;
class IdbBuilder;
class IdbDesign;
class IdbCellMaster;
class IdbBlockage;
class IdbRow;
} // namespace idb

namespace ieda_contest {

class DbInterface;
class ToConfig;
class Tree;

class GateSizing {
 public:
  GateSizing(idb::IdbBuilder *idb_build, ista::TimingEngine *timing) {
    _db_interface = new DbInterface(idb_build, timing);
  }
  ~GateSizing() = default;

  DbInterface *get_db_interface() {
    return _db_interface;
  }
  
  void doGateSizing(double time, uint64_t &init_area, uint64_t &max_area);
  void doDownSize(uint64_t &init_area, uint64_t &max_area);

 private:
  DbInterface *_db_interface = nullptr;
};

} // namespace ieda_contest
